/**
 */
package ConnectorGenerator.ElementArchitecture.impl;

import ConnectorGenerator.ElementArchitecture.*;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;

import org.eclipse.emf.ecore.impl.EFactoryImpl;

import org.eclipse.emf.ecore.plugin.EcorePlugin;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Factory</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class ElementArchitectureFactoryImpl extends EFactoryImpl implements ElementArchitectureFactory {
	/**
	 * Creates the default factory implementation.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static ElementArchitectureFactory init() {
		try {
			ElementArchitectureFactory theElementArchitectureFactory = (ElementArchitectureFactory)EPackage.Registry.INSTANCE.getEFactory("http://congen.ea/1.0"); 
			if (theElementArchitectureFactory != null) {
				return theElementArchitectureFactory;
			}
		}
		catch (Exception exception) {
			EcorePlugin.INSTANCE.log(exception);
		}
		return new ElementArchitectureFactoryImpl();
	}

	/**
	 * Creates an instance of the factory.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ElementArchitectureFactoryImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public EObject create(EClass eClass) {
		switch (eClass.getClassifierID()) {
			case ElementArchitecturePackage.REALIZED_FEATURE: return createRealizedFeature();
			case ElementArchitecturePackage.SUB_ELEMENT: return createSubElement();
			case ElementArchitecturePackage.FEATURE_MAPPING: return createFeatureMapping();
			case ElementArchitecturePackage.ATTRIBUTE_MAPPING: return createAttributeMapping();
			case ElementArchitecturePackage.ELEMENT_ARCHITECTURE: return createElementArchitecture();
			case ElementArchitecturePackage.LOCAL_BINDING: return createLocalBinding();
			case ElementArchitecturePackage.ATTRIBUTE: return createAttribute();
			case ElementArchitecturePackage.SIGNATURE_CONSTRAINT: return createSignatureConstraint();
			case ElementArchitecturePackage.SIGNATURE_VARIABLE: return createSignatureVariable();
			case ElementArchitecturePackage.ELEMENT_TYPE: return createElementType();
			case ElementArchitecturePackage.PORT: return createPort();
			case ElementArchitecturePackage.REMOTE_BINDING: return createRemoteBinding();
			case ElementArchitecturePackage.REMOTE_ENDPOINT: return createRemoteEndpoint();
			default:
				throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object createFromString(EDataType eDataType, String initialValue) {
		switch (eDataType.getClassifierID()) {
			case ElementArchitecturePackage.PORT_KIND:
				return createPortKindFromString(eDataType, initialValue);
			default:
				throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String convertToString(EDataType eDataType, Object instanceValue) {
		switch (eDataType.getClassifierID()) {
			case ElementArchitecturePackage.PORT_KIND:
				return convertPortKindToString(eDataType, instanceValue);
			default:
				throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public RealizedFeature createRealizedFeature() {
		RealizedFeatureImpl realizedFeature = new RealizedFeatureImpl();
		return realizedFeature;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public SubElement createSubElement() {
		SubElementImpl subElement = new SubElementImpl();
		return subElement;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public FeatureMapping createFeatureMapping() {
		FeatureMappingImpl featureMapping = new FeatureMappingImpl();
		return featureMapping;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public AttributeMapping createAttributeMapping() {
		AttributeMappingImpl attributeMapping = new AttributeMappingImpl();
		return attributeMapping;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ElementArchitecture createElementArchitecture() {
		ElementArchitectureImpl elementArchitecture = new ElementArchitectureImpl();
		return elementArchitecture;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public LocalBinding createLocalBinding() {
		LocalBindingImpl localBinding = new LocalBindingImpl();
		return localBinding;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Attribute createAttribute() {
		AttributeImpl attribute = new AttributeImpl();
		return attribute;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public SignatureConstraint createSignatureConstraint() {
		SignatureConstraintImpl signatureConstraint = new SignatureConstraintImpl();
		return signatureConstraint;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public SignatureVariable createSignatureVariable() {
		SignatureVariableImpl signatureVariable = new SignatureVariableImpl();
		return signatureVariable;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ElementType createElementType() {
		ElementTypeImpl elementType = new ElementTypeImpl();
		return elementType;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Port createPort() {
		PortImpl port = new PortImpl();
		return port;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public RemoteBinding createRemoteBinding() {
		RemoteBindingImpl remoteBinding = new RemoteBindingImpl();
		return remoteBinding;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public RemoteEndpoint createRemoteEndpoint() {
		RemoteEndpointImpl remoteEndpoint = new RemoteEndpointImpl();
		return remoteEndpoint;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public PortKind createPortKindFromString(EDataType eDataType, String initialValue) {
		PortKind result = PortKind.get(initialValue);
		if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String convertPortKindToString(EDataType eDataType, Object instanceValue) {
		return instanceValue == null ? null : instanceValue.toString();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ElementArchitecturePackage getElementArchitecturePackage() {
		return (ElementArchitecturePackage)getEPackage();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @deprecated
	 * @generated
	 */
	@Deprecated
	public static ElementArchitecturePackage getPackage() {
		return ElementArchitecturePackage.eINSTANCE;
	}

} //ElementArchitectureFactoryImpl
